package ru.mipt.board.net
import scala.actors._

/**
 * Created by IntelliJ IDEA.
 * User: IL
 * Date: 19.09.2010
 * Time: 14:44:52
 * To change this template use File | Settings | File Templates.
 */

class WorkingActor extends Actor{
    val loader = new  BoardLoader
    def act(){
        loop{
            react{
                case (id: Int,callbackactor: Actor) =>
                    val message = try{
                        loader parseThread id
                    }catch{
                        case ex:IllegalArgumentException  =>
                            println(id.toString + " " + "explain this!")
                            List()
                    }
                    callbackactor ! (message,this)
                case _ => println("wrong message for worker actor")
            }
        }
    }
}